export const schema = {
    type: "page",
    title: "志愿时长",
    body: [
        {
            type: "nav",
            stacked: false,
            links: [
                {
                    label: "查看",
                    to: "/project/view/${id}"
                },
                {
                    label: "编辑",
                    visibleOn: 'acl.can("project:create")',
                    to: "/project/edit/${id}"
                },
                {
                    label: "签到码",
                    to: "/project/checkin/${id}",
                    // acl: "project:create",
                    visibleOn: 'acl.can("project:create")',
                },
                {
                    label: "录用管理",
                    to: "/project/hire/${id}",
                    visibleOn: 'acl.can("project:create")',
                    // acl: "project:create"
                },
                {
                    label: "志愿时长",
                    to: "/project/work/${id}",
                    visibleOn: 'acl.can("project:create")',
                    // acl: "project:create"
                }
            ]
        },

        {
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                type: "crud",
                api: "/api/project/${params.id}/reward?page=${page}",
                panelClassName: "no-border no-shadow bg-white",
                bulkActions: [
                    {
                        type: "button",
                        label: "补充时长",
                        actionType: "dialog",
                        level: "success",
                        dialog: {
                            title: "补充时长",
                            body: {
                                type: "form",
                                api: "post:/api/project/${params.id}/reward/${ids}",
                                controls: [
                                    {
                                        label: "添加时长",
                                        type: "number",
                                        name: "plus"
                                    }
                                ]
                            }
                        }
                    }
                ],
                columnsToggable: false,
                columns: [
                    {
                        label: "参加项目",
                        type: "tpl",
                        tpl:
                        "<a data-link='/project/view/${project.id}'>${project.name}</a>"
                    },
                    {
                        label: "姓名",
                        name: "user.volunteer.real_name"
                    },
                    {
                        label: "用户名",
                        name: "user.username"
                    },
                    {
                        label: "联系电话",
                        name: "user.volunteer.phone"
                    },
                    {
                        label: "累计补充时长",
                        name: 'append_reward_time_count'
                    },
                    {
                        label: "打卡时长",
                        name: 'clock_time_count'
                    }
                ]
            }
        }
    ]
};
